package com.dj.mingkong.common.exception;

/**
 * @author zenglonghui
 * @date: 2022/5/17 18:02
 */
public enum ExceptionCode {
    /**
     * 异常自定义信息
     */
    SUCCESS("0", "操作成功"),
    FAIL("100000", "操作失败"),
    NOT_SUPPORTED("100001", "渠道不支持该接口"),
    INVOKE("-2", "接口调用失败"),
    VALIDATION_FAIL("1000", "数据验证失败"),
    INVALID_PARAM("2000", "参数不合法"),
    DAO_ERR("60000", " 数据库访问异常"),
    SYSTEM_ERR("100001", "系统异常，请联系管理员"),
    NO_DATA("1001", "数据不存在"),
    UNAUTHORIZED("401", "未授权的访问"),
    EXPIRED("402", "登录已过期"),
    REPETITION("403", "帐号在别处登陆"),
    INVALID("405", "无效token"),
    NO_ACCESS("406", "无权限"),
    REQ_LIMIT("407", "访问频率太频繁，请稍后重试"),
    SUM_LACK("408", "账户余额不足");

    private final String code;
    private final String message;

    private ExceptionCode(String val, String info) {
        this.code = val;
        this.message = info;
    }

    public String getCode() {
        return this.code;
    }

    public String getMessage() {
        return this.message;
    }
}
